package ui;

import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.wb.swt.SWTResourceManager;

//音量条旁边的音量按钮
public class VolumeButton extends SwitchButton {

	public VolumeButton(Composite parent, int style) {
		super(parent, style);
		Initial(
				SWTResourceManager.getImage(MinWin.class, "/image/volume_deactive.png"),
				SWTResourceManager.getImage(MinWin.class, "/image/volume_active.png"),
				SWTResourceManager.getImage(MinWin.class, "/image/silence_deactive.png"),
				SWTResourceManager.getImage(MinWin.class, "/image/silence_active.png"),
				true);
	}
	@Override
	public void mouseUp(MouseEvent e) {
		super.mouseUp(e);
		if (state) {
			ui.global.Operation.recoverVolume();
		}else {
			ui.global.Operation.silence();
		}
	}
}
